
class LoginForm {
    constructor() {
        this.state = "hide";
    }
    show() {
        if (this.state !== "show") {
            this.state = "show";
        }
    }
    hide() {
        if (this.state !== "hide") {
            this.state = "hide";
        }
    }

    static #instance
    static getInstance() {
        if (!this.#instance) {
            this.#instance = new LoginForm();
        }
        return this.#instance;
    }
}

function main() {
    let l1 = LoginForm.getInstance();
    let l2 = LoginForm.getInstance();
    console.log(l1 === l2);
}

main();
